<!DOCTYPE html>
<html lang="ch">
    <head>
        <meta charset="UTF-8"
              name="viewport"
              content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <title>New VQ</title>
        <link rel="shortcut icon" href="../../img/icon.jpg">

        <script src="https://unpkg.com/vue@3"></script>
        <!-- import CSS -->
        <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
        <!--图标-->
        <script src="//unpkg.com/@element-plus/icons-vue"></script>
        <!-- import JavaScript -->
        <script src="https://unpkg.com/element-plus"></script>

        <script src="../../res_js/axios-0.18.0.js"></script>

        <link rel="stylesheet" href="../../index.css">
        <link rel="stylesheet" href="../index.css">
        <link rel="stylesheet" href="index.css">
        <script src="../../index.js"></script>
        <script src="../index.js"></script>
    </head>
    <body style="margin: 0;overflow: hidden">
        <div id="app" class="app" style="height: 100vh; overflow: hidden">
            <!--主体-->
            <el-container>
                <!--标题栏-->
                <el-header>
                    <el-menu
                            :default-active="activeIndex"
                            class="el-menu-demo"
                            mode="horizontal"
                            :ellipsis="false"
                            @select="handleSelect">
                        <el-menu-item><el-avatar shape="square" :size="20" fit="contain" src="/img/icon1.jpg"></el-avatar></el-menu-item>
                        <el-menu-item style="width: 13%" index="1" onclick="window.location.href='/PE/home/index.html'">主页</el-menu-item>
                        <el-menu-item style="width: 13%" index="2" onclick="window.location.href='/PE/friend/index.html'">好友</el-menu-item>
                        <el-menu-item style="width: 13%" index="3" onclick="window.location.href='/PE/sala/index.html'">大厅</el-menu-item>
                        <div class="flex-grow"></div>
                        <el-menu-item style="padding-left: 2%; padding-right: 2%" index="4" onclick="window.location.href='/PE/search/index.html'"><el-icon><Search></Search></el-icon>搜素&ensp;</el-menu-item>
                        <el-menu-item @click="userDrawer=true"><template #title><el-avatar src="/img/HeadSculpture.jpg" fit="cover"></el-avatar></template></el-menu-item>
                    </el-menu>
                </el-header>
                <!--内容-->
                <el-main class="main" style="height: 100vh; overflow: auto">
                    <el-form style="width: 100%; margin-top: 1%; margin-bottom: 1%"
                            :inline="true">
                        <el-form-item style="margin: 0%">
                            <el-input v-model="insertFriendAccount" id="insertFriendAccount" placeholder="好友账号"></el-input>
                        </el-form-item>
                        <el-form-item style="margin: 0%">
                            <el-button @click="insertFriend(this.insertFriendAccount)" type="primary">添加好友</el-button>
                        </el-form-item>
                    </el-form>
                    <el-tabs style="height: 94%; width: 100%" type="border-card"
                             :stretch="true">
                        <el-tab-pane label="好友" style="">
                            <el-table
                                    :data="friendTable"
                                    style="height: 100%;">
                                <el-table-column
                                        prop="username"
                                        align="center">
                                </el-table-column>
                                <el-table-column
                                        align="center">
                                    <template #default="scope">
                                        <!--开始聊天-->
                                        <el-button type="primary" @click="chat(scope.row)" circle><el-icon><Comment></Comment></el-icon></el-button>
                                        <!--删除好友-->
                                        <el-button type="danger" @click="deleteFriend(scope.row)" circle><el-icon><Delete></Delete></el-icon></el-button>
                                    </template>
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="关注">
                            <el-table style="height: 100%;"
                                      :data="userTable">
                                <el-table-column
                                        prop="username"
                                        align="center">
                                </el-table-column>
                                <el-table-column
                                        align="center">
                                    <template #default="scope">
                                        <!--删除好友-->
                                        <el-button type="danger" @click="deleteFriend(scope.row)">取消关注</el-button>
                                    </template>
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="粉丝">
                            <el-table style="height: 100%;"
                                      :data="fansTable">
                                <el-table-column
                                        prop="username"
                                        align="center">
                                </el-table-column>
                                <el-table-column
                                        align="center">
                                    <template #default="scope">
                                        <!--关注粉丝-->
                                        <el-button type="primary" @click="insertUser(scope.row.account)">关&ensp;注</el-button>
                                    </template>
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                    </el-tabs>
                    <el-backtop target=".main" :visibility-height=200></el-backtop>
                </el-main>
            </el-container>

            <!--登录注册-->
            <el-drawer
                    title="登录注册"
                    size="65%"
                    v-model="logInDrawer"
                    direction="btt"
                    :before-close="handleClose">
                <el-tabs style="margin: 5%" v-model="activeName" @tab-click="handleClick">
                    <!--登录-->
                    <el-tab-pane label="登录" name="1">
                        <el-form ref="form" :model="logInForm" label-width="80px">
                            <el-form-item label="账号">
                                <el-input v-model="logInForm.account"></el-input>
                            </el-form-item>
                            <el-form-item label="密码">
                                <el-input type="password" v-model="logInForm.password"></el-input>
                            </el-form-item>
                        </el-form>
                        <div style="margin-top: 8%; margin-bottom: 14%" slot="footer" class="dialog-footer">
                            <el-button style="float: left" @click="logInDrawer  = false">取 消</el-button>
                            <el-button style="float: right" type="primary" @click="logIn">登 录</el-button>
                        </div>
                    </el-tab-pane>
                    <!--注册-->
                    <el-tab-pane label="注册" name="2">
                        <el-form ref="form" :model="registerForm" label-width="80px">
                            <el-form-item label="电子邮箱">
                                <el-input v-model="registerForm.email"></el-input>
                            </el-form-item>
                            <el-form-item label="验证码">
                                <el-input style="width: 55%" v-model="registerForm.captcha"></el-input>
                                <el-button style="width: 35%; margin-left: 7%" type="primary" :disabled="sendCaptchaBtnDis"  @click="sendCaptcha('register', registerForm.email)" round>{{sendCaptchaBtnValue}}</el-button>
                            </el-form-item>
                            <el-form-item label="用户名">
                                <el-input v-model="registerForm.username"></el-input>
                            </el-form-item>
                            <el-form-item label="密码">
                                <el-input type="password" placeholder="长度需要在6-20位之内，且须含有字母和数字" v-model="registerForm.password1"></el-input>
                            </el-form-item>
                            <el-form-item label="确认密码">
                                <el-input type="password" placeholder="长度需要在6-20位之内，且须含有字母和数字" v-model="registerForm.password2"></el-input>
                            </el-form-item>
                        </el-form>
                        <div style="margin-top: 8%; margin-bottom: 14%" slot="footer" class="dialog-footer">
                            <el-button style="float: left" @click="logInDrawer  = false">取 消</el-button>
                            <el-button style="float: right" type="primary" @click="register">注 册</el-button>
                        </div>
                    </el-tab-pane>
                    <!--忘记密码-->
                    <el-tab-pane label="忘记密码" name="3">
                        <el-form ref="form" :model="forgotPasswordForm" label-width="80px">
                            <el-form-item label="电子邮箱">
                                <el-input v-model="forgotPasswordForm.email"></el-input>
                            </el-form-item>
                            <el-form-item label="验证码">
                                <el-input style="width: 55%" v-model="forgotPasswordForm.captcha"></el-input>
                                <el-button style="width: 35%; margin-left: 7%" type="primary" :disabled="sendCaptchaBtnDis"  @click="sendCaptcha('forgotPassword', forgotPasswordForm.email)" round>{{sendCaptchaBtnValue}}</el-button>
                            </el-form-item>
                            <el-form-item label="密码">
                                <el-input type="password" placeholder="长度需要在6-20位之内，且须含有字母和数字" v-model="forgotPasswordForm.password1"></el-input>
                            </el-form-item>
                            <el-form-item label="确认密码">
                                <el-input type="password" placeholder="长度需要在6-20位之内，且须含有字母和数字" v-model="forgotPasswordForm.password2"></el-input>
                            </el-form-item>
                        </el-form>
                        <div style="margin-top: 8%; margin-bottom: 14%" slot="footer" class="dialog-footer">
                            <el-button style="float: left" @click="logInDrawer = false">取 消</el-button>
                            <el-button style="float: right" type="primary" @click="forgotPassword()">忘 记</el-button>
                        </div>
                    </el-tab-pane>
                </el-tabs>
            </el-drawer>
            <!--用户-->
            <el-drawer
                    title="用户"
                    v-model="userDrawer"
                    :direction="rtl"
                    :size="300">
                <!--用户信息-->
                <el-card class="box-card">
                    <el-avatar :size="60" style="margin: 0 0 8% 0; float: left" src="/img/HeadSculpture.jpg" fit="cover"></el-avatar>
                    <dic style="float: left; text-align: left; margin-top: -1vh; margin-left: 1vw">
                        <p>{{this.myUser.username}}</p>
                        <p style="font-size: 80%">ID: {{this.myUser.account}}</p>
                    </dic>
                </el-card>
                <!--功能区-->
                <table align="center" style="width: 100%; margin: 4% 0 4% 0">
                    <tr>
                        <td colspan="2"><el-button style="width: 100%" type="warning" onclick="window.location.href='/PE/userCenter/index.html'" round>&emsp;用&emsp;户&emsp;中&emsp;心&emsp;</el-button></td>
                    </tr>
                    <tr>
                        <td><el-button style="width: 100%" type="primary" @click="modifyUsernameDrawer=true" round>修改名称</el-button></td>
                        <td><el-button style="width: 100%" type="primary" @click="modifyPasswordDrawer=true" round>修改密码</el-button></td>
                    </tr>
                    <tr>
                        <td><el-button style="width: 100%" type="info" tag="a" href="https://wwp.lanzoup.com/iEC150pka3la" target="_blank" round>下载软件</el-button></td>
                        <td><el-button style="width: 100%" type="danger" @click="exitAccount" round>退出登录</el-button></td>
                    </tr>
                </table>
                <!--消息中心-->
                <div style="width:100%; height: 80%; overflow: auto">
                    <el-card style="margin: 2%" shadow="hover">
                        欢迎使用VQ0.8.1测试版
                        <!--分割线-->
                        <el-divider></el-divider>
                        本次更新：
                        <ol>
                            <li>更新动态和大厅UI及其交互。</li>
                            <li>修复发布动态按钮不显示的问题。</li>
                        </ol>
                    </el-card>
                </div>
            </el-drawer>
            <!--修改名称-->
            <el-drawer
                    title="修改名称"
                    size="50%"
                    v-model="modifyUsernameDrawer"
                    direction="btt"
                    :before-close="handleClose">
                <el-form ref="modifyUsernameForm" :model="modifyUsernameForm" label-width="80px">
                    <el-form-item label="账号">
                        <el-input v-model="modifyUsernameForm.account"></el-input>
                    </el-form-item>
                    <el-form-item label="密码">
                        <el-input type="password" v-model="modifyUsernameForm.password"></el-input>
                    </el-form-item>
                    <el-form-item label="新名称">
                        <el-input v-model="modifyUsernameForm.newUsername"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="ackModifyUsername">修改</el-button>
                        <el-button @click="modifyUsernameDrawer = false">取消</el-button>
                    </el-form-item>
                </el-form>
            </el-drawer>
            <!--修改密码-->
            <el-drawer
                    title="修改密码"
                    size="50%"
                    v-model="modifyPasswordDrawer"
                    direction="btt"
                    :before-close="handleClose">
                <el-form ref="modifyPasswordForm" :model="modifyPasswordForm" label-width="80px">
                    <el-form-item label="旧密码">
                        <el-input type="password" v-model="modifyPasswordForm.oldPassword"></el-input>
                    </el-form-item>
                    <el-form-item label="新密码">
                        <el-input type="password" placeholder="长度需要在6-20位之内，且须含有字母和数字" v-model="modifyPasswordForm.newPassword1"></el-input>
                    </el-form-item>
                    <el-form-item label="确认密码">
                        <el-input type="password" placeholder="长度需要在6-20位之内，且须含有字母和数字" v-model="modifyPasswordForm.newPassword2"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="ackModifyPassword">修改</el-button>
                        <el-button @click="modifyPasswordDrawer = false">取消</el-button>
                    </el-form-item>
                </el-form>
            </el-drawer>

            <!--聊天框-->
            <el-drawer
                    title="聊天框"
                    size="100%"
                    v-model="ChatDrawer"
                    direction="btt"
                    :before-close="contentClose">
                <div id="chat_con" class="chat_con">
                    <!--聊天内容-->
                    <div id="content" class="content"></div>
                    <!--发送消息-->
                    <div slot="footer" class="dialog-footer">
                        <el-input style="width: 80%"
                                  id="textarea" type="textarea"
                                  :autosize="{ minRows: 1, maxRows: 4}"
                                  placeholder="请输入内容"
                                  v-model="message.content">
                        </el-input>
                        <el-button style="width: 20%; float: right; margin-bottom: 0%" type="primary" @click="send()">发 送</el-button>
                    </div>
                </div>
            </el-drawer>
        </div>

        <script src="index.js"></script>
    </body>
</html>